home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / Libraries / Icon / c / ScreenPos < prev    next >
Text File  |  1995-07-08  |  1KB  |  38 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Icon.ScreenPos.c
  12.     Author:  Copyright © 1994 Peter Gaunt
  13.     Version: 1.00 (12 Mar 1994)
  14.     Purpose: Get the position of an icon in screen coordinates.
  15. */
  16.  
  17. #include "DeskLib:WimpSWIs.h"
  18. #include "DeskLib:Coord.h"
  19. #include "DeskLib:Icon.h"
  20.  
  21.  
  22. extern void Icon_ScreenPos(window_handle window,
  23.                            icon_handle   icon,
  24.                            wimp_rect     *rect)
  25. {
  26.   icon_block   istate;
  27.   window_state wstate;
  28.  
  29.   Wimp_GetWindowState( window, &wstate );
  30.   Wimp_GetIconState( window, icon, &istate );
  31.  
  32.   Coord_RectToScreen( &istate.workarearect,
  33.                       (convert_block *) &wstate.openblock.screenrect );
  34.  
  35.   *rect = istate.workarearect;
  36.  
  37. }
  38.